package com.mall.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.entity.*;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderMapper extends BaseMapper<Order> {

    Long lockSkuStock(@Param("num") Integer num, @Param("skuId") Long skuId);

    List<Order> selectByUserId(Integer userId);

    List<skuList> selectByOrderId(String orderId);

    List<skuList> selectBySkuId(Integer skuId);

    void updateAddress(String orderId, String name, String mobile, String addrProvince, String addrCity, String addrArea, String addrStreet, String addrDetail);

    void updateStatus(String orderId, int status);

    List<TableData> queryAllOrder(String orderId, Integer start, Integer pageSize);

    Long queryCount(String orderId);

    void deleteOrder(String orderId);

    TableData queryOrder(String orderId);

    void updateOrder(String orderId, Integer status, String createTime);

    Integer queryUserId(String orderId);
}
